package request

import (
	"time"

	"gitcode.com/G-YT/baoyou/server/model/common/request"
	"gitcode.com/G-YT/baoyou/server/model/manager"
	"gorm.io/datatypes"
)

// RegisterRequest 健管师注册结构体
type RegisterRequest struct {
	Phone            string `json:"phone" form:"phone" binding:"required" validate:"required"`
	Password         string `json:"password" form:"password"`
	ConfirmPassword  string `json:"confirmPassword" form:"confirmPassword" binding:"required" validate:"required,eqfield=Password"`
	Name             string `json:"name" form:"name" binding:"required" validate:"required"`
	ServiceStationID uint   `json:"serviceStationID" form:"serviceStationID" binding:"required" validate:"required"` // 服务站ID
	Code             string `json:"code" binding:"required" validate:"required"`
}

// PasswordLoginRequest 密码登录结构体
type PasswordLoginRequest struct {
	Phone    string `json:"phone" binding:"required" validate:"required"`
	Password string `json:"password" binding:"required" validate:"required"`
}

// CodeLoginRequest 验证码登录结构体
type CodeLoginRequest struct {
	Phone string `json:"phone" binding:"required" validate:"required"`
	Code  string `json:"code" binding:"required" validate:"required"`
}

type RetrievePasswordRequest struct {
	Phone           string `json:"phone" form:"phone" binding:"required" validate:"required"`
	Code            string `json:"code" binding:"required" validate:"required"`
	Password        string `json:"password" form:"password"`
	ConfirmPassword string `json:"confirmPassword" form:"confirmPassword" binding:"required" validate:"required,eqfield=Password"`
}

type HealthManagerSearch struct {
	manager.HealthManager
	Phone          string     `json:"phone" form:"phone"`
	Name           string     `json:"name" form:"name"`
	StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	request.PageInfo
}

type IdsHReq struct {
	Ids []int `json:"hmIds" form:"hmIds"`
}

type ManagerRank struct {
	ServiceStation uint `json:"serviceStation" form:"serviceStation"`
	ServiceCentre  uint `json:"serviceCentre" form:"serviceCentre"`
	Grade          uint `json:"grade" form:"grade"`
	//Sort           string `json:"sort" form:"sort"`
	//Order          string `json:"order" form:"order"`
	request.PageInfo
}

type HealthManagerIDs struct {
	UIDs string `json:"uids" form:"uids"`
	request.PageInfo
}

// UpdateManagerRequest 修改健管师信息请求结构体
type UpdateManagerRequest struct {
	Avatar              string         `json:"avatar" form:"avatar"`
	Name                string         `json:"name" form:"name"`
	Sex                 *int           `json:"sex" form:"sex"`
	Phone               string         `json:"phone" form:"phone"`
	IDNumber            string         `json:"IDNumber" form:"IDNumber"`
	CertificationImages datatypes.JSON `json:"certificationImages" form:"certificationImages"`
	CertificationNo     string         `json:"certificationNo" form:"certificationNo"`
}

// ChangePasswordRequest 修改密码请求结构体
type ChangePasswordRequest struct {
	Phone              string `json:"phone" form:"phone"`
	OldPassword        string `json:"oldPassword" form:"oldPassword"`
	NewPassword        string `json:"newPassword" form:"newPassword"`
	ConfirmNewPassword string `json:"confirmNewPassword" form:"confirmNewPassword"`
}
